import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getwidget/components/appbar/gf_appbar.dart';
import 'package:getwidget/components/button/gf_icon_button.dart';
import 'package:getwidget/types/gf_button_type.dart';

import '../controllers/gfappbar_controller.dart';

class GfappbarView extends GetView<GfappbarController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('应用头'),
        centerTitle: true,
        // elevation: 0,
      ),
      body: Container(
        child: ListView(
          children: [
            GFAppBar(
              leading: GFIconButton(
                icon: Icon(
                  Icons.message,
                  color: Colors.white,
                ),
                onPressed: () {},
                type: GFButtonType.transparent,
              ),
              title: Text("GF Appbar"),
              actions: <Widget>[
                GFIconButton(
                  icon: Icon(
                    Icons.favorite,
                    color: Colors.white,
                  ),
                  onPressed: () {},
                  type: GFButtonType.transparent,
                ),
              ],
            ),

            GFAppBar(
              leading: GFIconButton(
                icon: Icon(
                  Icons.message,
                  color: Colors.white,
                ),
                onPressed: () {},
                type: GFButtonType.transparent,
              ),
              searchBar: true,
              title: Text("GF Appbar"),
              actions: <Widget>[
                GFIconButton(
                  icon: Icon(
                    Icons.favorite,
                    color: Colors.white,
                  ),
                  onPressed: () {},
                  type: GFButtonType.transparent,
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
